<template>
  <div class="RecommendedListBox">
    <ul class="LeaderboardBox">
      <li
        v-for="childList in LeaderboardList"
        :key="childList.id"
        class="LeaderboardItemBox"
      >
        <div class="childListItemTitleBox">
          <img :src="childList.coverImgUrl" class="childListimgBox" alt="" />
          <div class="childListRightBox">
            <p class="childListItemTit">{{ childList.name }}</p>
            <div class="childListRightBtnBox">
              <div class="childListRightPlayBtn"></div>
              <div class="childListRightCollectionBtn"></div>
            </div>
          </div>
        </div>
        <ul>
          <li
            class="LeaderboardListItem"
            v-for="(item, index) in childList.tracks"
            :key="index"
          >
            <span class="SerialNumber">{{ index + 1 }}</span>
            <span class="itemName">{{ item.first }}</span>
            <div class="operationBox">
              <div class="palyBtn"></div>
              <div class="addSongSheetBtn"></div>
              <div class="CollectionBtn"></div>
            </div>
          </li>
          <li class="LeaderboardListItem seeMore">查看全部></li>
        </ul>
      </li>
    </ul>
  </div>
</template>


<script>
import { recommendList } from "@/api";
export default {
  data: function () {
    return {
      LeaderboardList: [],
    };
  },
  props: {},
  created() {
    this.getRecommendList();
  },
  methods: {
    getRecommendList() {
      recommendList().then((res) => {
        this.LeaderboardList = res.list.splice(0, 3);
        // console.log(this.LeaderboardList, 9999);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.LeaderboardBox {
  display: flex;
  border-top: 1px solid #d3d3d3;
  border-left: 1px solid #d3d3d3;
  border-bottom: 1px solid #d3d3d3;
  .LeaderboardItemBox {
    flex: 1;
    border-right: 1px solid #d3d3d3;
  }
}
.LeaderboardListItem {
  display: flex;
  justify-content: space-between;
  &:nth-child(1) {
    .SerialNumber {
      color: #c10d0c;
    }
  }
  &:nth-child(2) {
    .SerialNumber {
      color: #c10d0c;
    }
  }
  &:nth-child(3) {
    .SerialNumber {
      color: #c10d0c;
    }
  }
  .SerialNumber {
    width: 35px;
    height: 32px;
    text-align: center;
    color: #666;
    font-size: 16px;
    line-height: 32px;
  }
  .itemName {
    color: #000;
    line-height: 32px;
    font-size: 12px;
    flex: 1;
  }
  .operationBox {
    display: none;
    float: right;
    align-items: center;
    .palyBtn {
      width: 17px;
      height: 17px;
      background: url("./../../assets/imges/PopularRecommendationIcon.png")
        no-repeat -267px -268px;
      margin-right: 10px;
    }
    .addSongSheetBtn {
      width: 17px;
      height: 17px;
      background: url("./../../assets/imges/btnIconTwo.png") no-repeat 3px -698px;
      margin-right: 10px;
    }
    .CollectionBtn {
      width: 17px;
      height: 17px;
      background: url("./../../assets/imges/PopularRecommendationIcon.png")
        no-repeat -296px -268px;
      margin-right: 10px;
    }
  }
  &:nth-child(odd) {
    background: #e8e8e8;
  }
  &:hover {
    .operationBox {
      display: flex;
    }
  }
}
.childListItemTitleBox {
  display: flex;
  padding: 20px 0 0 19px;
  height: 100px;
  .childListimgBox {
    width: 80px;
    height: 80px;
  }
  .childListRightBox {
    margin: 6px 0 0 10px;
    flex: 1;
    .childListItemTit {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 14px;
      color: #333;
      font-weight: 700;
    }
    .childListRightBtnBox {
      display: flex;
      margin-top: 10px;
      .childListRightPlayBtn {
        width: 22px;
        height: 22px;
        margin-right: 10px;
        background: url("./../../assets/imges/PopularRecommendationIcon.png")
          no-repeat -267px -205px;
      }
      .childListRightCollectionBtn {
        width: 22px;
        height: 22px;
        margin-right: 10px;
        background: url("./../../assets/imges/PopularRecommendationIcon.png")
          no-repeat -300px -205px;
      }
    }
  }
}
.seeMore {
  text-align: right;
  line-height: 32px;
  justify-content: flex-end;
  font-size: 12px;
  padding-right: 10px;
}
.RecommendedListBox {
  margin: 20px 0 37px;
}
</style>